package com.jeasonzhao.report.codes;

import com.jeasonzhao.commons.basic.IntegerPair;

/**
 * @todo Change the title into english or remove it directly
 */
public final class ColumnRotateHeaderModes extends IntegerPair
{
    private static final long serialVersionUID = 1L;
    public static final ColumnRotateHeaderModes None = new ColumnRotateHeaderModes( -1,"不旋转",null);
    public static final ColumnRotateHeaderModes FixedHeader = new ColumnRotateHeaderModes(1,"精简模式","fix,fixed,fixHeader,fixedHeader,true"); //尽量减少列，度量在下面
    public static final ColumnRotateHeaderModes BalanceHeader = new ColumnRotateHeaderModes(2,"平衡模式","balance,balanced,balanceHeader,balancedHeader"); //尽量扩展列，度量在下面
    public static final ColumnRotateHeaderModes R_FixedHeader = new ColumnRotateHeaderModes(3,"倒转精简模式","r_fix,r_fixed,r_fixHeader,r_fixedHeader,r_true"); //尽量减少列，度量在上面
    public static final ColumnRotateHeaderModes R_BalanceHeader = new ColumnRotateHeaderModes(4,"倒转平衡模式","r_balance,r_balanced,r_balanceHeader,r_balancedHeader"); //尽量扩展列，度量在上面
    public static final ColumnRotateHeaderModes E_FixedHeader = new ColumnRotateHeaderModes(5,"精简（隐藏单度量）","e_fix,e_fixed,e_fixHeader,e_fixedHeader,e_true"); //尽量减少列，度量在下面
    public static final ColumnRotateHeaderModes E_BalanceHeader = new ColumnRotateHeaderModes(6,"平衡（隐藏单度量）","e_balance,e_balanced,e_balanceHeader,e_balancedHeader"); //尽量扩展列，度量在下面

    protected ColumnRotateHeaderModes(int nId,String strName,String strAlias)
    {
        super(nId,strName,strAlias);
    }

    public static ColumnRotateHeaderModes fromName(String strName)
    {
        return(ColumnRotateHeaderModes) IntegerPair.findConstant(ColumnRotateHeaderModes.class,strName,None);
    }

    public int hashCode()
    {
        return super.hashCode();
    }

    public boolean isRotate()
    {
        return this.equals(None) == false;
    }

    public boolean isFixedHeader()
    {
        return this.equals(R_FixedHeader) || this.equals(FixedHeader) || this.equals(E_FixedHeader);
    }

    public boolean isRotateMeasureAtTop()
    {
        return this.equals(R_FixedHeader) || this.equals(R_BalanceHeader);
    }

    public boolean isHideSingleMeasure()
    {
        return this.equals(E_FixedHeader) || this.equals(E_BalanceHeader);
    }
}
